Skip to content

Refactor UI layout: move tabs to dedicated bar, add FAB menu#10

Merged
asystemoffields merged 1 commit intomainfrom
claude/revert-before-fabs-removal-TSEFu
Mar 26, 2026
Merged

Refactor UI layout: move tabs to dedicated bar, add FAB menu#10
asystemoffields merged 1 commit intomainfrom
claude/revert-before-fabs-removal-TSEFu

Conversation

@asystemoffields
Copy link
Copy Markdown
Owner

Summary

This PR restructures the editor's UI layout by separating tabs into a dedicated tab bar below the title bar, and replacing the inline dropdown menu with a floating action button (FAB) menu system on the left side of the title bar.

Key Changes

  • Tab bar separation: Moved tab rendering and interaction from the title bar to a new dedicated render_tabbar() function. Tabs now occupy their own horizontal bar with consistent spacing and layout.

  • FAB menu system: Replaced the single dropdown trigger button with a row of four FAB buttons (File, Edit, View, Settings) positioned on the left side of the title bar. Each FAB displays a Unicode icon and can be clicked to toggle its associated menu.

  • Menu dropdown simplification: Removed category headers and separators between menu groups. The dropdown now displays only items from the selected menu, reducing visual clutter and simplifying the menu structure.

  • Layout constants updated:

    • TITLEBAR_H: 36 → 40 pixels
    • TABBAR_H: 6 → 38 pixels (now a functional tab bar instead of spacing)
    • MENUBAR_H: remains 0 (unused)
  • State tracking refactored:

    • Replaced dropdown_hover and dropdown_btn_x with fab_hover (tracks which FAB is hovered)
    • Updated menu_hover_item to use per-menu indexing instead of flat indexing across all menus
    • Added menu_bar_widths[] array for FAB width tracking
  • Click and hover handling: Updated mouse event handlers to work with the new FAB positions and simplified menu structure. FAB hover now supports menu switching when a menu is already open.

Implementation Details

  • FAB buttons are rendered as rounded squares with Unicode icons (hamburger menu, pencil, search, gear)
  • FAB positioning uses consistent spacing: fab_start_x + i * (fab_size + fab_pad)
  • Menu dropdown position is calculated relative to the clicked FAB's x-coordinate
  • Tab bar click detection now checks the dedicated tab bar region instead of the title bar

https://claude.ai/code/session_012jkEhwey5QbTAnq7dCnaU7

Restores prose_code.h, render.c, and wndproc.c to the version at
commit f29ad5d, undoing the FAB-to-dropdown-menu conversion and
subsequent titlebar/tabbar merging.

https://claude.ai/code/session_012jkEhwey5QbTAnq7dCnaU7
@asystemoffields asystemoffields merged commit c0ce704 into main Mar 26, 2026
1 of 2 checks passed
@asystemoffields asystemoffields deleted the claude/revert-before-fabs-removal-TSEFu branch March 26, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants